import pika, sys

credentials = pika.PlainCredentials('admin', 'admin')
conn_param = pika.ConnectionParameters('jgwh.iask.in', 5672, '/',  credentials = credentials)

conn_broker = pika.BlockingConnection(conn_param)

channel = conn_broker.channel()

channel.exchange_declare(exchange = "hello-exchange", type = "direct", passive = False, durable = True, auto_delete = True)

msg = sys.argv[1]
msg_props = pika.BasicProperties()
msg_props.content_type = "text/plain"

channel.basic_publish(body = msg, exchange = "hello-exchange", properties = msg_props, routing_key = "hi")
